package secondStage.part4.特殊操作流;

import java.util.Properties;
import java.util.Set;

/**
 * @ClassName: [ProPertiesDemo]
 * @Description: ProPerties 作为Map集合使用
 * @Author: [黄劲松]
 * @CreateDate: [2021-04-05]
 * @Version: [v1.0]
 */
/*
    ProPerties 作为Map集合的使用
*/
public class ProPertiesDemo {
    public static void main(String[] args) {
        //创建集合对象
    //Properties<String,String> prop = new Properties<String,String>();//错误，不能使用泛型
        Properties pro = new Properties();
        //存储元素
        pro.put("a001","画风");
        pro.put("a002","金额");
        pro.put("a003","偶读");
        //遍历集合
        Set<Object> keySet = pro.keySet();
        for (Object key: keySet) {
            Object value = pro.get(key);
            System.out.println(key+","+value);
        }
    }

}
